﻿<?php
include('../Modules/admin_resist_mdl.php');
// include('doctype.htm');
?>

<body>

<script language="javascript">
	
	function addLHDL()
	{
		window.location = "admin_.php?part=addlhdl";
	}
	
	function edit_lhdl(id)
	{
		location.href = "admin.php?part=editlhdl&malh=" + id;
	}	
	
	function del_lhdl(id)
	{
		if (confirm("Bạn có chắc muốn xóa?"))
			location.href = "xoa_lhdl.php?malh=" + id;
	}
	
</script>

<div>
<?php

include('conn.php');

$query = "select * from sinh_vien";
$result = mysql_query($query, $conn) or die(mysql_error());

?>

<h4>Quản lý tài khoản</h4>

<table>
	<tr>
		<th>MSSV</th>
		<th>Họ và tên</th>
	</tr>
	
<?php

while ($row = mysql_fetch_array($result))
{
	echo '
	<tr>
		<td>'.$row['MSSV'].'</td>
		<td>'.$row['TEN_SV'].'</td>
		<td><input type="button" value="Sửa" onclick="edit_lhdl('.$row['MSSV'].')"></td>
		<td><input type="button" value="Xóa" onclick="del_lhdl('.$row['MSSV'].')"></td>
	</tr>';
}

?>

</table>				

<input type="button" value="Thêm mới" name="btnAddNew" onClick="addLHDL();">

</div>
</body>